//此代码由机器自动生成，请不要手动修改
namespace WpfTest.BLL{
	namespace TestService_ {
	//原始js通讯声明
		declare function mbQuery(msgId: number, request: string, onResponse: (id: number, response: string) => any): void;
		//js通讯回调
		function OnResponse(msgId: number, response: string) {
			response = decodeURI(response);
			response = unescape(response);
			return response;
		}
		//js通道异步封装
		export async function TneQueryAsync(msgId: number, request: string): Promise<any> {
			return new Promise<any>((resolve, reject) => {
				//调用原始callback的js通讯接口
				request = escape(request);
				mbQuery(msgId, request, (id, response) => {
					resolve(OnResponse(id, response));
				});
			});
		}
		export class ServiceInvokeInfo{
			public ServicePath: string;
			public MethodName: string;
			public Args: Array<any>;
		}
	}
	export class TestService {
		public async Add(x:number,Update:(arg0:Array<WpfTest.Entity.UserInfo>)=>boolean):Promise<number>{
			let serviceInvokeInfo = new TestService_.ServiceInvokeInfo();
			serviceInvokeInfo.ServicePath = "WpfTest.BLL.ITestService,WpfTest";
			serviceInvokeInfo.MethodName = "Add";
			serviceInvokeInfo.Args = new Array<any>();
			if (x as any instanceof Function) {
				(window as any).Tne_TestService_Add_896555 = x;
				function x_(json: string) {
					json = decodeURI(json);
					json = unescape(json);
					let args = JSON.parse(json);
					let jsr: any = new Object();
					try {
						jsr.Result = (window as any).Tne_TestService_Add_896555(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]);
						delete ((window as any).Tne_TestService_Add_896555);
						jsr.Status = true;
						jsr.ErrorMessage = "null";
					}
					catch (err) {
						jsr.Result == "WpfTest.BLL.TestService.Add";
						jsr.Status = false;
						jsr.ErrorMessage = err;
					}
					let rjson = JSON.stringify(jsr);
					return escape(rjson);
				}
				serviceInvokeInfo.Args.push(x_.toString());
			}
			else {
				serviceInvokeInfo.Args.push(x);
			}
			if (Update as any instanceof Function) {
				(window as any).Tne_TestService_Add_598883 = Update;
				function Update_(json: string) {
					json = decodeURI(json);
					json = unescape(json);
					let args = JSON.parse(json);
					let jsr: any = new Object();
					try {
						jsr.Result = (window as any).Tne_TestService_Add_598883(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]);
						delete ((window as any).Tne_TestService_Add_598883);
						jsr.Status = true;
						jsr.ErrorMessage = "null";
					}
					catch (err) {
						jsr.Result == "WpfTest.BLL.TestService.Add";
						jsr.Status = false;
						jsr.ErrorMessage = err;
					}
					let rjson = JSON.stringify(jsr);
					return escape(rjson);
				}
				serviceInvokeInfo.Args.push(Update_.toString());
			}
			else {
				serviceInvokeInfo.Args.push(Update);
			}
			let request = JSON.stringify(serviceInvokeInfo);
			let resultJson = await TestService_.TneQueryAsync(8262020, request);
			let result = JSON.parse(resultJson);
			if (result.Status == true) {
				return result.Result;
			}
			else {
				throw result;
			}
		}
	}
}
